﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Text;

namespace FastORM.Entity
{
    public class LocalTransaction
    {
        public string RootThreadID { set; get; }
        public string TransitionID { set; get; }
        public DbTransaction Transition { set; get; }
        List<Action> TransitionActionList{ set; get; }
        public LocalTransaction()
        {
            TransitionActionList = new List<Action>();
        }
        public void AddTransitionAction(Action TransitionAction)
        {
            TransitionActionList.Add(TransitionAction);
        }
        public void Execute()
        {
            for (int i = 0; i < TransitionActionList.Count; i++)
            {
                TransitionActionList[i]();
            }
        }
    }
}
